Repository navigation
feat: cluster split validation — Phase 2 benchmark honesty - #6
Closed
cschanhniem wants to merge 1 commit into
Closed
cschanhniem wants to merge 1 commit into
cschanhniem wants to merge 1 commit into
Conversation
- Add cluster_by_similarity() and cluster_split() to splits.py: greedy
single-linkage clustering groups near-duplicate sequences so benchmark
reference and test sets are never contaminated by each other
- Add find_contaminated_references() to evaluate.py: identifies reference
sequences that are near-duplicates of test positives (Phase 2 leakage check)
- Add recall_at_k(), random_recall_at_k(), enrichment_factor(),
benchmark_summary() to evaluate.py (full benchmark evaluation suite)
- Add test_cluster_split.py: 21 tests covering clustering properties,
split partitioning, contamination detection, and end-to-end enrichment
verification — all 3 positives rank above negatives without references,
confirming scoring is feature-based not reference-proximity-based
- Add examples/benchmark/cluster_split_{pool,refs}.csv test data
- Fix ruff F401 unused imports in pipeline.py, test_cli.py, test_pipeline_filters.py
- 58 tests passing, ruff clean
Collaborator
Author
|
Superseded by PR #11 (feat/integrate-all-phases), which merges all Phase 2 + Phase 3 work into a single consolidation PR with 251 tests passing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 2: Cluster split requirement from AGENTS.md:
cluster_by_similarity(sequences, threshold)— greedy single-linkage clustering; sequences withinthresholdnormalized Levenshtein similarity are co-clusteredcluster_split(sequences, threshold)— splits a sequence set into(reference_indices, test_indices)so no cluster spans both sides; guarantees no test sequence has a near-duplicate in the reference setfind_contaminated_references()— identifies reference sequences that are near-duplicates of test positives; removes benchmark inflation from reference-set memorizationrecall_at_k,random_recall_at_k,enrichment_factor,benchmark_summaryadded toevaluate.pyWhat the tests prove
The key finding: AMP-like sequences score above non-AMP negatives on activity/safety/synthesis features alone, without needing reference proximity — confirming the pipeline is not inflated by memorization.
Test plan
make test— 58 tests passruff check src tests— cleanexamples/benchmark/cluster_split_{pool,refs}.csv